
#include <iostream>
#include "Sort.h"
using namespace std;

int main()
{
    // 测试各个排序算法
    int a[] = {1, 3, 5, 7, 9, 2, 4, 6, 8, 0};
    int n = sizeof(a) / sizeof(int);

    InsertSort(a, n);
    cout << " 插入排序：";
    PrintArray(a, n);

    ShellSort(a, n);
    cout << " 希尔排序：";
    PrintArray(a, n);

    SelectSort(a, n);
    cout << " 选择排序：";
    PrintArray(a, n);

    HeapSort(a, n);
    cout << " 堆排序：  ";
    PrintArray(a, n);

    BubbleSort(a, n);
    cout << " 冒泡排序：";
    PrintArray(a, n);

    QuickSort(a, 0, n - 1);
    cout << " 快速排序：";
    PrintArray(a, n);

    QuickSort_NonRecursion(a, 0, n - 1);
    cout << "非递归快： ";
    PrintArray(a, n);

    MergeSort(a, n);
    cout << " 归并排序：";
    PrintArray(a, n);

    MergeSort_NonRecursion1(a, n);
    cout << "非递归并： ";
    PrintArray(a, n);

    MergeSort_NonRecursion2(a, n);
    cout << "非递归并： ";
    PrintArray(a, n);

    CountSort(a, n);
    cout << " 计数排序：";
    PrintArray(a, n);

    return 0;
}